<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>头部信息</title>
<script type="text/javascript">
Ext.onReady(function() {
	Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
	
	
	 $("#userShow").text(MyExt.getUser());
	$("#sayHelloSpan").text(MyExt.sayHello());
    $("#todayDate").html(MyExt.getToday());
});


//账户信息
function editUser(){
	Ext.create('Ext.window.Window',{
		title: '账户信息',
		width: 350,
		height: 400,
		modal: true,
		maximizable: false,
		resizable: false,
		layout:'fit',
		plain: true,
		autoLoad:{url:'data/editUser.html',scripts:true,nocache:true}
		
	}).show();
	
}

//修改密码
function editPassword(){
	Ext.create('Ext.window.Window',{
		
		title: '修改密码',
		width: 300,
		height: 180,
		modal: true,
		maximizable: false,
		resizable: false,
		layout:'fit',
		plain: true,
		autoLoad:{url:'data/changePwd.html',scripts:true,nocache:true}
	}).show();
	
}

/**
 * 用于显示万年历
 */
function openCalendar(){
 var openCalendar=	Ext.create('Ext.window.Window',{
		title: '万年历',
		width: 437,
		height: 550,
		modal: true,
		maximizable: false,
		resizable: false,
		layout:'fit',
		bodyStyle: 'background-color:#ffffff;',
		html: '<iframe src="data/common/calendar.html" width="450px" height="520px;" style="margin-left:10px;" frameborder="0"></iframe>',
		buttons: [{
		text    : '关闭',
	
	    handler : function() {
	    	openCalendar.close();
	    }}
		]
	}).show();
}

//用户退出
function logout(){
	Ext.Msg.confirm("警告", "确定要退出吗？", function(btn){
		if(btn=="yes"){
			// 发送请求
			MyExt.ajaxRequest({
				baseUrl: '',
				action: '../json/exit.jsp',
				callback: function(jsonResult){
					Ext.state.Manager.set('Mynote_autoLogin', false);
					location.href="../index.html";
				},
				showWaiting: true
			});
		}
	});
}

</script>
</head>
<body>
	<div id="headerDiv">
		<table style="width:100%;height:100%;table-layout:fixed;">
			<tr>
				<td width="180px" height="78px"><a href=""><img src="../common/image/logo.png"></img></a></td>
				<td align="right" class="loginInfo" >
				<br>
					<span style="padding:3px 10px 3px 18px;" class="user" style="height:20px;">
						<span id="userShow"></span> - <span id="sayHelloSpan"></span>
					</span>
					<span style="padding:3px 10px 3px 18px;" class="user_edit" style="height:20px;"><a href="javascript:editUser();">账户信息</a></span>
					<span style="padding:3px 10px 3px 18px;" class="key" style="height:20px;"><a href="javascript:editPassword();">修改密码</a></span>
					
					<span style="padding:3px 10px 3px 18px;" class="user_go" style="height:20px;"><a href="javascript:logout();">退出</a></span>
				</td>
				<td width="180px" align="right" style="padding-right:5px;" class="loginInfo">
				<br>
					<div id="todayDate"></div>
				</td>
			</tr>
		</table>
    </div>
</body>
</html>